package core;

import java.util.ArrayList;
import java.util.List;

public final class SimpleImageProcessor extends AbstractImageProcessor {

	private List<IPixelProcessor> processors = new ArrayList<>();

	public void addPixelProcessor(IPixelProcessor processor) {
		processors.add(processor);
	}

	public void removePixelProcessor(IPixelProcessor processor) {
		processors.remove(processor);
	}

	@Override
	public int[] processPixel(int[] pixel, int x, int y) {
		for (IPixelProcessor p : processors) {
			p.processPixel(pixel, x, y);
		}
		return pixel;
	}

}
